<script setup>
import { RouterView } from 'vue-router'
import NavBar from './components/NavBar.vue'
</script>

<template>
  <div class="app-container">
    <!-- 侧边导航栏 -->
    <NavBar class="side-nav" />

    <!-- 主内容区 -->
    <main class="main-content">
      <RouterView />
    </main>

    <!-- 音乐播放器 -->
    <div class="music-player">
      <div class="player-content">
        <div class="song-info">
          <img 
            src="https://picsum.photos/200" 
            class="album-cover"
            alt="album cover"
          >
          <div class="track-info">
            <div class="song-name">正在播放的歌曲</div>
            <div class="artist-name">歌手名称</div>
          </div>
        </div>
        <div class="player-controls">
          <button class="control-btn">⏮️</button>
          <button class="play-btn">▶️</button>
          <button class="control-btn">⏭️</button>
        </div>
        <div class="volume-control">
          <span class="volume-icon">🔊</span>
          <input 
            type="range"
            min="0"
            max="100"
            value="80"
            class="volume-slider"
          >
        </div>
      </div>
    </div>
  </div>
</template>

<style>
:root {
  --primary-color: #6200EA;
  --secondary-color: #7C4DFF;
  --accent-color: #B388FF;
  --bg-dark: #121212;
  --bg-light: #1E1E1E;
  --text-light: #FFFFFF;
  --text-gray: #B3B3B3;
  --nav-width: 240px;
  --player-height: 80px;
  --success-color: #00C853;
  --warning-color: #FFD600;
  --error-color: #FF1744;
}

body {
  margin: 0;
  font-family: 'Roboto', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-light);
}

* {
  box-sizing: border-box;
}
</style>

<style scoped>
.app-container {
  min-height: 100vh;
  display: flex;
}

.side-nav {
  width: var(--nav-width);
  background-color: var(--bg-light);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  bottom: var(--player-height);
  z-index: 100;
}

.main-content {
  flex: 1;
  margin-left: var(--nav-width);
  margin-bottom: var(--player-height);
  padding: 2rem;
  min-height: calc(100vh - var(--player-height));
}

.music-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--player-height);
  background-color: var(--bg-light);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 200;
}

.player-content {
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.song-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 200px;
}

.album-cover {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
}

.track-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.song-name {
  font-weight: 500;
}

.artist-name {
  color: var(--text-gray);
  font-size: 0.9rem;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.control-btn,
.play-btn {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-btn:hover {
  background-color: var(--secondary-color);
  transform: scale(1.1);
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 150px;
}

.volume-slider {
  flex: 1;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background-color: var(--primary-color);
  border-radius: 50%;
  cursor: pointer;
}

@media (max-width: 768px) {
  .side-nav {
    width: 60px;
  }

  .main-content {
    margin-left: 60px;
    padding: 1rem;
  }

  .player-content {
    padding: 0 1rem;
  }

  .track-info,
  .volume-control {
    display: none;
  }

  .player-controls {
    flex: 1;
    justify-content: center;
  }
}
</style>
